 {

        var o = function () {
        };
        o.prototype = {
            _playModel: "",
            _rooms_xueliu: [],
            _rooms_xuezhan: [],
            _rooms_erren: [],
            _rooms_errenquick: [],
            _roomId: 0,
            ctor: function () {
                this.setPlayModel(Global.config.playModel.XUEZHAN);
            },
            updateData: function (e) {
                if (e) {
                    var t = e.play_mode;
                    t == Global.config.playModel.XUEZHAN && (console.log("xuezhan room", e.rooms), this._rooms_xuezhan = e.rooms),
                    t == Global.config.playModel.XUELIU && (console.log("xueliu room", e.rooms), this._rooms_xueliu = e.rooms),
                    t == Global.config.playModel.ERREN && (this._rooms_erren = e.rooms), t == Global.config.playModel.ERRENQUICK && (this._rooms_errenquick = e.rooms);
                }
            },
            setPlayModel: function (e) {
                this._playModel = e;
            },
            getPlayModel: function () {
                return this._playModel;
            },
            getRooms: function () {
                return this._playModel == Global.config.playModel.XUEZHAN ? this._rooms_xuezhan : this._playModel == Global.config.playModel.XUELIU ? this._rooms_xueliu : this._playModel == Global.config.playModel.ERREN ? this._rooms_erren : this._playModel == Global.config.playModel.ERRENQUICK ? this._rooms_errenquick : [];
            },
            getRoomOnlineNum: function (e) {
                var t = 0, n = [];
                e == Global.config.playModel.XUEZHAN ? n = this._rooms_xuezhan : e == Global.config.playModel.XUELIU ? n = this._rooms_xueliu : e == Global.config.playModel.ERREN ? n = this._rooms_erren : e == Global.config.playModel.ERRENQUICK && (n = this._rooms_errenquick);
                for (var o = 0; o < n.length; o++) {
                    var i = n[o];
                    t += i[1], console.log("getRoomOnlineNum", i, i[1]);
                }
                return console.log("getRoomOnlineNum " + e + " num==" + t), t;
            },
            hasXueZhanRooms: function () {
                return this._rooms_xuezhan.length > 0;
            },
            hasXueLiuRooms: function () {
                return this._rooms_xueliu.length > 0;
            },
            hasErrenRooms: function () {
                return this._rooms_erren.length > 0;
            },
            hasErrenQuickRooms: function () {
                return this._rooms_errenquick.length > 0;
            },
            setRoomId: function (e) {
                this._roomId = e;
            },
            getRoomId: function () {
                return this._roomId;
            },
            getNotZiZunOrFuHao: function () {
                var e = this.getRoomId(), t = parseInt(e / 1e4), n = Global.configCdn.getUISwitchConf(),
                    o = [201104, 201105, 201204, 201205];
                if (n && n.cancelRoom && (o = n.cancelRoom), o && o.length > 0) for (var i in o) if (o[i] == t) return !1;
                return !0;
            },
            getRoomInfo: function (e) {
                var t = null, n = null;
                if (this._playModel == Global.config.playModel.XUEZHAN && (n = this._rooms_xuezhan),
                this._playModel == Global.config.playModel.XUELIU && (n = this._rooms_xueliu), this._playModel == Global.config.playModel.ERREN && (n = this._rooms_erren),
                this._playModel == Global.config.playModel.ERRENQUICK && (n = this._rooms_errenquick),
                n && e || cc.error("getRoomInfo tmpRooms = " + n + "   this._playModel:" + this._playModel + "roomId:" + e),
                    !e) return (e = this.getRecommendRoomId()) < 0 ? (console.error("getRoomInfo roomid<0", e),
                    t) : this.getRoomInfo(e);
                for (var o = parseInt(e / 1e4), i = 0; i < n.length; i++) {
                    var a = n[i];
                    if (parseInt(a[0] / 1e4) == o) {
                        t = a;
                        break;
                    }
                }
                return t;
            },
            getRecommendRoomId: function (e, t) {
                e = void 0 == e ? 1 : e, t = void 0 == t || t;
                var n = this.getRooms(), o = Global.userProfile, i = 0;
                o && o.getUserProfile() && (i = o.getUserProfile().chip);
                var a = i, r = -1;
                if (n && n.length > 0) {
                    for (var s = !1, l = n.length - 1; l >= 0; l -= 2) {
                        if ((u = n[l]) && u[5]) {
                            var c = u[5].min_coin, d = u[5].max_coin;
                            if (a >= e * c && (d < 0 || a <= d)) {
                                r = u[0], s = !0;
                                break;
                            }
                        }
                    }
                    if (0 == s) for (l = n.length - 2; l >= 0; l -= 2) {
                        var u;
                        if ((u = n[l]) && u[5]) {
                            c = u[5].min_coin, d = u[5].max_coin;
                            if (a >= e * c && (d < 0 || a <= d)) {
                                r = u[0];
                                break;
                            }
                        }
                    }
                    -1 == r && t && (r = this.getFirstRoomId());
                }
                return r;
            },
            getFirstRoomId: function () {
                var e = this.getRooms(), t = -1;
                if (e) {
                    var n = e[0];
                    n && n[5] && (t = n[0]);
                }
                return t;
            }
        },  module.exports = o
    }